package org.springframework.ioc.beanfactory.pojo;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanClassLoaderAware;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.ioc.beanfactory.beanprocess.CustomBeanPostProcessor;
import org.springframework.ioc.beanfactory.beanprocess.CustomMergedBeanDefinitionPostProcessor;

public class BeanLife implements BeanNameAware,BeanClassLoaderAware,BeanFactoryAware,InitializingBean{
	
	private String name;
	
	public BeanLife(){
		System.out.println("BeanLife construct invoke now");
	}

	public void destroy() throws Exception {
		System.out.println(getClass()+" invoke [DisposableBean] method");
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println(getClass()+" invoke [initializingBean] method");
	}

	@Override
	public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
		System.out.println(getClass() + " invoke [BeanFactoryAware] method");
	}

	@Override
	public void setBeanClassLoader(ClassLoader classLoader) {
		System.out.println(getClass() + " invoke [BeanClassLoaderAware] method");
	}

	@Override
	public void setBeanName(String name) {
		System.out.println(getClass() + " invoke [BeanNameAware] method");
	}
	
	public void customInit(){
		System.out.println(getClass()+" invoke [customeInit] method");
	}
	
	public void customDisposable(){
		System.out.println(getClass() + " invoke [customeDisposable] method");
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		System.out.println(getClass()+" invoke [setName] method");
		this.name = name;
	}

}
